import https from "@/utils/https";
//1.提交商品评价
export const submitCommentAPI = (data) => {
  return https.request({
    url: "/member/order/comment",
    method: "POST",
    data,
  });
};

export const getCommentAPI = (data) => {
  return https.request({
    url: "/goods/comment",
    method: "post",
    data,
  });
};

export const likeCommentAPI = (commentId) => {
  return https.request({
    url: `/goods/comment/like`,
    method: "put",
    params: { commentId },
  });
};
export const dislikeCommentAPI = (commentId) => {
  return https.request({
    url: `/goods/comment/dislike`,
    method: "put",
    params: { commentId },
  });
};

export const getSubCommentAPI = (commentId,page,pageSize) => {
  return https.request({
    url: `/goods/comment/reply`,
    method: "get",
    params: { commentId,page,pageSize },
  });
};

export const replyCommentAPI = (data) => {
  return https.request({
    url: `/goods/comment/reply`,
    method: "post",
    data,
  });
};

export const uploadAPI = (data) => {
  return https.post("/upload", data, { headers: { "Content-Type": "multipart/form-data" } });
};

export const getLikeListAPI = () => {
  return https.request({
    url: "/user/likes",
    method: "get",
  });
};